import Vue from 'vue'
import App from './App.vue'
import { router } from './router'
import store from './store'
import 'normalize.css/normalize.css'
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/index.scss' // global css
import './icons' // icon
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
import * as echarts from 'echarts' //  引入Echarts，
Vue.prototype.$echarts = echarts //  定义为全局变量

Vue.use(Element, {
  size: 'medium' // set element-ui default size
})

Vue.config.productionTip = false

NProgress.configure({ showSpinner: false }) // NProgress Configuration

Vue.prototype.$$router = router

// 添加getter用于判断登录状态
store.getters = {
  ...store.getters,
  isLogin: state => {
    return state.user.userName !== null && state.user.userName !== undefined
  }
}

new Vue({
  router: router,
  store: store,
  render: h => h(App)
}).$mount('#app')
